package com.feihong.yw189.adapter;

import android.app.Activity;
import android.content.Context;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.feihong.yw189.R;
import com.feihong.yw189.model.PaiHangModel;
import com.feihong.yw189.model.User.money.ShareListDetailModel;
import com.holenzhou.pullrecyclerview.BaseRecyclerAdapter;
import com.holenzhou.pullrecyclerview.BaseViewHolder;

import java.util.ArrayList;
import java.util.List;

import de.hdodenhof.circleimageview.CircleImageView;


/**
 * Created by PVer on 2018/1/5.
 */

public  class ShareListDetailAdapter extends BaseRecyclerAdapter<ShareListDetailModel.DataBean.ListBean> {

    Activity mcontext;
    ArrayList<ShareListDetailModel.DataBean.ListBean> paihangTodayBeans;

    public ShareListDetailAdapter(Context context, int layoutResId, List<ShareListDetailModel.DataBean.ListBean> data) {
        super(context, layoutResId, data);
        mcontext= (Activity) context;
        paihangTodayBeans= (ArrayList<ShareListDetailModel.DataBean.ListBean>) data;
    }

    @Override
    protected void convert(BaseViewHolder holder, ShareListDetailModel.DataBean.ListBean item) {
        holder.setText(R.id.share_list_order,item.getOrder_sn());
        holder.setText(R.id.share_list_phone_num,item.getMobile());
        holder.setText(R.id.share_list_time,item.getAdd_time());
        holder.setText(R.id.share_list_status,item.getStatus_name());

        TextView textView = holder.getView(R.id.share_list_status);
        if(item.getStatus_name().contains("提交")){
            textView.setTextColor(mContext.getResources().getColorStateList(R.color.common_color_yello));
        }else if(item.getStatus_name().contains("完成")){
            textView.setTextColor(mContext.getResources().getColorStateList(R.color.common_font_color_green));
        }else if(item.getStatus_name().contains("失败")){
            textView.setTextColor(mContext.getResources().getColorStateList(R.color.common_font_color_red));
        }else{
            textView.setTextColor(mContext.getResources().getColorStateList(R.color.common_font_color_black));
        }
    }
}
